<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{pmsg}}</div>
        <menu-item title="来自父组件的值"></menu-item>
        <menu-item :title="ptitle"></menu-item>
    </div>
    <script src="../vue.min.js"></script>
    <script>
        Vue.component('menu-item', {
            props: ['title'],
            data: function () {
                return {
                    msg: '子组件本身数据'
                }
            },
            template: '<div>{{msg +"-----"+ title}}</div>'
        })
        var app = new Vue({
            el: '#app',
            data: {
                pmsg: '父组件中内容',
                ptitle: '动态'
            }
        })
    </script>
</body>

</html>